<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>搜索结果</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
</head>

<body>
<!--导航-->
<nav th:replace="_fragments :: menu(0)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header secondary item">Blog</h2>
            <a href="#" class="m-item item m-mobile-hide"><i class="home icon"></i>首页</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="idea icon"></i>分类</a>
            <a href="#" class="active m-item item m-mobile-hide"><i class="tags icon"></i>标签</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="clone icon"></i>归档</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="info icon"></i>关于我</a>
            <div class="right item m-mobile-hide">
                <div class="ui category search">
                    <div class="ui icon input">
                        <input class="prompt" type="text" placeholder="Search animals...">
                        <i class="search icon"></i>
                    </div>
                    <div class="results"></div>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle grey icon button m-top-right m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>


<!--中间内容 m-container样式 左右存在间距-->
<div class="m-container m-padded-tb-big">
    <!--根据屏幕的尺寸达到最好的效果 attached浮加  bottom,top圆角-适应移动端-->
    <div class="ui container">
        <!--头部 top attached 连成一个无间隙-->
        <div class="ui top attached segment">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <h3 class="ui teal header">搜索结果</h3>
                </div>
                <div class="right aligned column">
                    共 <h3 class="ui pink header m-inline-block m-text-thin" th:text="${page.total}">14</h3>&nbsp;篇
                </div>
            </div>
        </div>

        <!--具体的文章列表-->
        <div class="ui  top attached teal segment">
            <!--文章-->
            <div class="ui padded vertical segment m-padded-tb-normal" th:each="blog : ${page.list}">
                <div class="ui middle aligned mobile reversed stackable grid">
                    <div class="eleven wide column">
                        <h3 class="ui header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank"
                                                 class="m-black" th:text="${blog.title}">听说，那片樱花又开了。</a></h3>
                        <p class="m-text" th:text="|${blog.description}|">初次听到那片关于樱花的消息时还是懵懵懂懂的年纪，
                            转眼却已过了多年。在时间的打磨下已褪去了年少的浮躁与轻狂本以为不会再对樱花有所悸动，
                            但听到关于它的消息时却还是不免心潮澎湃，一瞬间，有关樱花的记忆喷涌而来，被浓烈的樱花香重重包围，
                            无法逃脱却也是不知所措……
                        </p>
                        <div class="ui stackable grid">
                            <div class="eleven wide column">
                                <div class="ui horizontal link list">
                                    <!--头像avatar-->
                                    <div class="item">
                                        <img src="https://unsplash.it/100/100?image=1005"
                                             th:src="@{${blog.user.avatar}}" alt="" class="ui avatar image">
                                        <div class="content">
                                            <a href="#" class="ui pink label m-padded-mini"
                                               th:text="${blog.user.nickname}">
                                                Andy
                                            </a>
                                        </div>
                                    </div>
                                    <!--日期-->
                                    <div class="item">
                                        <i class="calendar icon"></i><span
                                            th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2021-3-17</span>
                                    </div>
                                    <!--浏览次数-->
                                    <div class="item">
                                        <i class="eye icon"></i> <span th:text="${blog.views}">1212</span>
                                    </div>
                                </div>
                            </div>

                            <div class="right aligned five wide column">
                                <a href="#" target="_blank" class="ui teal label m-padded-mini"
                                   th:text="${blog.type.name}">认知升级</a>
                            </div>
                        </div>
                    </div>

                    <div class="five wide column">
                        <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                            <img src="https://picsum.photos/800/400" th:src="@{${blog.firstPicture}}" alt=""
                                 class="ui rounded image">
                        </a>
                    </div>

                </div>
            </div>

            <!--end--文章-->
        </div>
        <!--footer 上一页 下一页-->
        <div class="ui bottom attached segment" th:if="${page.total}>1">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <a class="ui left labeled icon button" th:href="@{/main/(pageNum=${page.prePage})}"
                       th:unless="${page.isFirstPage}"><i class="left arrow icon"></i>上一页 </a>
                </div>
                <div class="right aligned column">
                    <a class="ui right labeled icon button"
                       th:href="@{/main/(pageNum=${page.hasNextPage}?${page.nextPage}:${page.pages})}"
                       th:unless="${page.isLastPage}">下一页 <i class="right arrow icon"></i></a>
                </div>
            </div>
        </div>
        <!--footer 上一页 下一页--end-->
        <!--edn--具体的文章列表-->
    </div>
</div>
<br>
<br>
<br>

<br>

<br>

<!--底部footer-->
<footer th:replace="_fragments :: footer" class="ui inverted divided vertical segment m-padded-tb-massive">
    <div class=" ui stackable center aligned container">
        <div class="ui inverted divided stackable grid">
            <!--二维码-->
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../static/images/wechat.jpg" class="ui rounded" style="width: 130px" alt="">
                    </div>
                </div>
            </div>

            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">最新博客</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">用户故事 (User Story)</a>
                    <a href="#" class="item">用户故事 (User Story)</a>
                    <a href="#" class="item">用户故事 (User Story)</a>
                </div>
            </div>

            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">联系我</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">Email: 1490477595@qq.com</a>
                    <a href="#" class="item">QQ: 1490477595</a>
                </div>
            </div>

            <div class=" seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">博猪寄语</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">
                    你遇到的每个人都是别人想见又见不到的人，请珍惜每一刻相处的时光，因为我们不知道哪一次再见，会变成再也不见。</p>
            </div>
        </div>
        <!--线条-->
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-small">Copyright © 2020 - 2021 AndyLee</p>
    </div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>

<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });
</script>

</body>
</html>
